
<{include file="app/header.tpl"}>

	<form method="POST" class="login-form" >
		<input type="hidden" name="referrer" value="<{$referrer}>">

		<h1 class="logo" title="柚子购物">
			<img class="img" src="/resource/app/imgs/logo.png" alt="">
		</h1>
		<p class="wrap"><input type="number" class="number" name="mobile" id="" placeholder="手机号登陆" ></p>
		<p class="wrap"><input type="password" class="password" name="password" id="" placeholder="密码" ></p>
 		<p class="wrap fix">
            <span class="error"></span>
            <a href="/login/forget" class="forget-password" title="">忘记密码？</a>
        </p>
		<p class="wrap"><input type="submit" class="submit" name="" id="" value="登 录" onclick="return submit_login();"></p>
		<p class="wrap"><a href="/register" class="click-register" title="">注 册</a></p>
                <{if $site == 'other'}>
		<ul class="wechat-sina fix">
			<li class="li"><a class="a fix" href=""><img class="img" src="/resource/app/imgs/wechat.png" alt=""><span class="text" onclick="window.youzi.client_login_wechat()">微信登陆</span></a></li>
			<li class="li"><a class="a fix" href=""><img class="img" src="/resource/app/imgs/sina.png" alt=""><span class="text" onclick="window.youzi.client_login_sina()">微博登陆</span></a></li>
		</ul>
                <{else $site == 'weixin'}>
                    <p class="wrap"><a href="/login/verify_weixin" class="submit" title="">微 信 登 陆</a></p>
                <{/if}>
                

	</form>

<script>

function submit_login(){

    var mobileNumberReg = /^(13[0-9]|15[012356789]|17[0678]|18[0-9]|14[57])[0-9]{8}$/,
        oNumVal = $('.number').val();

    if (!mobileNumberReg.test(oNumVal)) {
        try
        {
            $('.error').html('请输入正确的手机号码');
        }catch(err) {
        }
        finally{
        }
        return false;
    }

    var oPassword = $('.password').val();
    if (!oPassword) {
        try
        {
            $('.error').html('请输入密码');
        }catch(err) {
        }
        finally{
        }
        return false;
    }

    // 当密码错误的时候触发 start
    // $('.error').html('密码或手机号错误')
    // 当密码错误的时候触发 end

    return true;
}
function enter_submit_login(){
    return submit_login();
}

document.body.style.backgroundColor = '#fff';

var login_status = <{$login_status}>;
if(login_status == 1)
{
    $('.error').html('账号或密码错误！');
}


$(document).ready(function(){
    var site = '<{$site}>';
    if(site == 'other')
    {
        try {
            window.youzi.is_in_app();
        } catch (e){
            //
            $('.wechat-sina').eq(0).hide();
        }
    }
});

</script>

<{include file="app/footer.tpl"}>
